package com.softer.wxzj.controller;

import com.github.pagehelper.PageInfo;
import com.softer.wxzj.common.aop.annotation.LogRecord;
import com.softer.wxzj.common.aop.enums.LogOperationType;
import com.softer.wxzj.common.aop.enums.LogOperationUnit;
import com.softer.wxzj.common.entity.CommonResult;
import com.softer.wxzj.common.entity.Page;
import com.softer.wxzj.entity.OrgRegionAudit;
import com.softer.wxzj.service.OrgRegionAuditService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 小区区域绑定
 *
 * @author Gong Zhiyang
 * @date 2020/5/28
 */
@RestController
@RequestMapping("/orgRegionAudit")
public class OrgRegionAuditController {
    @Autowired
    private OrgRegionAuditService orgRegionAuditService;

    /**
     * 查询区域绑定列表
     *
     * @return
     */
    @PostMapping("/getRegionAuditList")
    @LogRecord(description = "查询区域绑定列表", operationUnit = LogOperationUnit.ORG_REGION, operationType = LogOperationType.SELECT)
    public PageInfo<OrgRegionAudit> getRegionAuditList(Page page, OrgRegionAudit orgRegionAudit) {
        return orgRegionAuditService.getRegionAuditList(page, orgRegionAudit);
    }
    /**
     * 查询登陆人审核列表
     */
    @PostMapping("/selectAuditByOrgRegion")
    @LogRecord(description = "查询登陆人审核列表", operationUnit = LogOperationUnit.ORG_REGION, operationType = LogOperationType.SELECT)
    public PageInfo<OrgRegionAudit> selectAuditByOrgRegion(Page page, OrgRegionAudit orgRegionAudit){
        return orgRegionAuditService.selectAuditByOrgRegion(page, orgRegionAudit);

    }
    /**
     * 审核
     */
    @PostMapping("/submitAndAudit")
    @LogRecord(description = "审核区域管理", operationUnit = LogOperationUnit.ORG_REGION, operationType = LogOperationType.SELECT)
    public CommonResult submitAndAudit(String id,String opinion,String mark){
        return orgRegionAuditService.submitAndAudit(id, opinion, mark);

    }


}
